package com.j.lemon.learn.jvm.gc;

/**
 * @Author lijunjun
 * @Date 2020-02-10 15:48
 * @Description 对象优先分配在eden区域,eden区没有足够空间时，触发一次minor GC
 * JVM参数：-Xms20M -Xmx20M -Xmn10M -XX:+PrintGCDetails -XX:+SurvivorRatio=8
 * 堆内存初始大小20M，堆内存最大20M，新生代10M，eden和survivor比例为8：1
 */
public class EdenFirst {
    private static final int _1MB = 1024 * 1024;
    public static void test() throws InterruptedException {
        byte [] a1,a2,a3,a4;
        a1 = new byte[2 *_1MB ];
        a2 = new byte[2 *_1MB ];
        a3 = new byte[2 *_1MB ];
        a4 = new byte[2 *_1MB ];
    }

    public static void main(String[] args) throws InterruptedException {
        test();
    }

}
